//
//  UIImage+Category.m
//  买家版首页
//
//  Created by 王天义 on 16/8/16.
//  Copyright © 2016年 TYWang. All rights reserved.
//

#import "UIImage+Category.h"

@implementation UIImage (Category)
+ (UIImage *)imageWithNamed:(NSString *)name{
    
    UIImage *image = nil;
    if (IOS7) {
        NSString *newName = [name stringByAppendingString:@"_os7"];
        image = [UIImage imageNamed:newName];
    }
    if (image == nil){
        image = [UIImage imageNamed:name];
    }
    return image;
}
+ (UIImage *)resizedImageNamed:(NSString *)name{
    UIImage *image = [UIImage imageWithNamed:name];
    return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height *0.5];
}
@end
